Public Class FormReaderTest
    Private m_BCReaderManager As CCasioDTX7 = New CCasioDTX7()

    Private Sub FormReaderTest_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        m_BCReaderManager.CloseReader()
        Me.Dispose()
    End Sub

    Private Sub FormReaderTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AddHandler m_BCReaderManager.OnBCDataRead, AddressOf BCReaderManager_OnBCDataRead

        m_BCReaderManager.OpenReader()
    End Sub

    Private Sub BCReaderManager_OnBCDataRead(ByVal sender As Object, ByVal e As BarcodeEventArgs)
        Debug.WriteLine("BCReaderManager_OnBCDataRead:" + e.ReadText)
        ReadTextBox.Text = e.ReadText
        ReadListBox.Items.Add(e.ReadText)
        ReadListBox.SelectedIndex = (ReadListBox.Items.Count - 1)
    End Sub

    Private Sub EndButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EndButton.Click
        Me.Close()
    End Sub
End Class